#ifndef TRANSFORM_H
#define TRANSFORM_H

#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>

struct Transform {
    glm::mat4 mat;
    
    Transform(): mat(glm::mat4(1.0f)) {}

    const glm::mat4 &get() const {
        return mat;
    }

    Transform &translate(const glm::vec3 &vec) {
        mat = glm::translate(mat, vec);
        return *this;
    }

    Transform &rotate(float deg, const glm::vec3 &axis = glm::vec3(0, 0, 1)) {
        mat = glm::rotate(mat, glm::radians(deg), axis);
        return *this;
    }

    Transform &scale(float ratio) {
        mat = glm::scale(mat, glm::vec3(ratio, ratio, ratio));
        return *this;
    }

    Transform &scale(const glm::vec3 &ratio) {
        mat = glm::scale(mat, ratio);
        return *this;
    }
};

#endif // TRANSFORM_H
